
#include <Windows.h>
#include "NonWindow.h"

HINSTANCE	g_hInst;
HWND		g_hWnd;

// Laziest WndProc, ever.
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	return DefWindowProc(hWnd, message, wParam, lParam);
}

void MakeWindow()
{
	g_hInst = GetModuleHandle(NULL);
	UINT uiStyle,uiStyleX;
	uiStyle = (WS_OVERLAPPEDWINDOW | WS_VISIBLE) ^ WS_MAXIMIZEBOX ^ WS_THICKFRAME;
	uiStyleX = NULL;

	WNDCLASSEX wcex;
	wcex.cbSize = sizeof(WNDCLASSEX);
	wcex.style			= 0;
	wcex.lpfnWndProc	= WndProc;
	wcex.cbClsExtra		= 0;
	wcex.cbWndExtra		= 0;
	wcex.hInstance		= g_hInst;
	wcex.hCursor		= NULL;
	wcex.hIconSm		= NULL;
	wcex.hIcon			= NULL;
	wcex.hbrBackground	= (HBRUSH)GetStockObject(BLACK_BRUSH);
	wcex.lpszMenuName	= NULL;
	wcex.lpszClassName	= TEXT("Dummy Window");

	RegisterClassEx(&wcex);

	g_hWnd = CreateWindowEx(uiStyleX, wcex.lpszClassName, "Dummy Window", uiStyle,
		(GetSystemMetrics(SM_CXSCREEN) >> 1) - (WINDOW_WIDTH >> 1), (GetSystemMetrics(SM_CYSCREEN) >> 1) - (WINDOW_HEIGHT >> 1), 
		WINDOW_WIDTH, WINDOW_HEIGHT, NULL, NULL, g_hInst, NULL);

	ShowWindow(g_hWnd, 0);
}
